import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThreaLoacalDemo {

    public static ExecutorService threadPool= Executors.newFixedThreadPool(16);

    public static void main(String[] args) {
        for (int i = 0; i <1000 ; i++) {
            int finalI = i;
            threadPool.execute(()->{
                System.out.println(new ThreaLoacalDemo().getSecond(finalI));
            });
        }
        threadPool.shutdown();
    }

    public String getSecond(int value){
        Date date=new Date(1000*value);
        return threadLocal.dateFormatThreadLocal.get().format(date);
    }


}

class threadLocal{
    public static ThreadLocal<SimpleDateFormat> dateFormatThreadLocal=new ThreadLocal<SimpleDateFormat>(){
        @Override
        protected  SimpleDateFormat initialValue(){
            return new SimpleDateFormat("mm:ss");
        }
    };
}
